﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MqttServerTest.Model
{
    public class SerialPortGet : Status
    {
        public SerialPort[] PortList { get; set; }
    }

    public class SerialPort
    {
        /// <summary>
        /// 串口号
        /// </summary>
        public string Port { get; set; } = "com2";
        /// <summary>
        /// 是否开启串口
        /// </summary>
        public string Enabled { get; set; } = "true";
        /// <summary>
        /// 232串口服务器端口
        /// </summary>
        public int RS232_port {  get; set; }
        /// <summary>
        /// 485串口服务器端口
        /// </summary>
        public int RS485_port {  get; set; }
        /// <summary>
        /// 串口工作模式.tcp/udp/modbus，modbus模式为RS485接口独有
        /// </summary>
        public string Mode { get; set; } = "modbus";
        /// <summary>
        /// 透传模式下串口重连时间周期，默认值300。单位：秒
        /// </summary>
        public int Interval { get; set; } = 300;
        /// <summary>
        /// 透传模式下读时延，默认值1000。单位：毫秒
        /// </summary>
        public int Delay { get; set; } = 1000;
        /// <summary>
        /// 串口波特率
        /// </summary>
        public int Baudrate { get; set; } = 9600;
        /// <summary>
        /// 数据位
        /// </summary>
        public int Databit { get; set; } = 8;
        /// <summary>
        /// 停止位
        /// </summary>
        public int Stopbit { get; set; } = 1;
        /// <summary>
        /// 校验位
        /// </summary>
        public string Checkdigit { get; set; } = "none";

    }
}
